<?php
namespace Service;

use Library\Log;


/**
 * BaseService
 * @author los_gsy
 */
class BaseService {
	/**
	 * 构造函数
	 */
	public function __construct() {
	}


	/**
	 * __call
	 * 魔术方法，不会被Yar_Server暴露
	 */
// 	public function __call($method, $args) {
// 		$calledClass = get_called_class();
// 		$calledClass = substr($calledClass, 8);
// 		$calledClass = substr($calledClass, 0, -7);
// 		$calledClass = '\Model\\' . $calledClass . 'Model';
// 		if (!method_exists($calledClass, $method)) {
// 			Log::warning(__METHOD__ . '$calledClass = ' . $calledClass . ', $method = ' . $method . ', $args = ' . var_export($args, true));
// 			return false;
// 		}
// 		$result = call_user_func_array([new $calledClass, $method], $args);
// 		return $result;
// 	}


	/**
	 * __callStatic
	 * 魔术方法，不会被Yar_Server暴露
	 */
// 	static public function __callStatic($method, $args) {
// 		$calledClass = get_called_class();
// 		$calledClass = substr($calledClass, 8);
// 		$calledClass = substr($calledClass, 0, -7);
// 		$calledClass = '\Model\\' . $calledClass . 'Model';
// 		if (!method_exists($calledClass, $method)) {
// 			Log::warning(__METHOD__ . ': $calledClass = ' . $calledClass . ', $method = ' . $method . ', $args = ' . var_export($args, true));
// 			return false;
// 		}
// 		$result = call_user_func_array([$calledClass, $method], $args);
// 		return $result;
// 	}



}